﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
	<title>还卡超人</title>
    <link rel="stylesheet" type="text/css" href="css/h.css">
    <link rel="stylesheet" type="text/css" href="css/hht.css">
	<style type="text/css">
	    *{margin:0;padding:0;}
	    body{background-color:#fff;text-align:center;}
        header{background-color:#fff;margin-bottom:10px;}
        img{width:100%;}
        .btn{width:41%;margin:10px auto;}
        .center{padding:10px 0;background-color:#f3f3f8;}
        .wx_img{ width: 100%; position:fixed; z-index: 2; top: 0; left: 0 }
	</style>
</head>
<body>
	<div class="main">
        <div id="hua">
        </div>
		<header>
		    <img src="images/center.png">
		    <img src="images/banner.png" class="btn" id="btn">
		</header>
		<div class="center">
			<img src="images/center.png?v=1">
		</div>
		<img src="images/bank_intro.png?v=1">
	</div>
</body>
<script src="//m.ppdaicdn.com/act/hh_dwload/js/zepto.min.js"></script>
<script>
    var GetQueryString = function(name) {
         var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)","i");
         var r = window.location.search.substr(1).match(reg);
         if (r!=null) return (r[2]); return null;
    }
    var  isWeiXin = function(){ 
        var ua = window.navigator.userAgent.toLowerCase();
        if (ua.match(/MicroMessenger/i) == 'micromessenger') {
            return true;
        } else {
            return false;
        }
    }
    var loadIframe = null,
        androidURL = null,
        isWx       = isWeiXin(),
        appSrc     =  "ppdai.caocao://com.ppdai.loan.caocao",
        isiOS      = navigator.userAgent.match('iPad')
                     || navigator.userAgent.match('iPhone')
                     || navigator.userAgent.match('iPod'), 
		//dlurl =  GetQueryString("url"),
        //iosURL     = dlurl ? dlurl:"https://itunes.apple.com/cn/app/jie-zou-da-shi/id1176078944?mt=8",
        isAndroid  = navigator.userAgent.match('Android'),
        pakName    = GetQueryString("source");
        if(!pakName)pakName = '';
        androidURL = "https://m.ppdai.com/down/huanhuan/"+pakName;
        //区分各投放渠道和短链;
        switch(pakName){
        	case 'njylb':
        	iosURL = 'https://at.umeng.com/eCW9ni';
        	break;
        	case 'njzjb':
        	iosURL = 'https://at.umeng.com/HHHXve';
        	break;
        	case 'njzt':
        	iosURL = 'https://at.umeng.com/K5nGjm';
        	break;
        	case 'njzjh':
        	iosURL = 'https://at.umeng.com/Ovy8fe';
        	break;
        	case 'pfqhb':
        	iosURL = 'https://at.umeng.com/HDiqeC';
        	break;
        	default:
            iosURL = 'https://itunes.apple.com/cn/app/jie-zou-da-shi/id1176078944?mt=8';
        }
        /*if (isWx) {
           if(isAndroid){
               var wxContent = '<img src="//m.ppdaicdn.com/img/app/public.png" class="wx_img">';
               $(wxContent).appendTo($('body'));
               location.href=androidURL;
            }
        }*/
$('#btn').on('click',function(){
    if(isiOS){
	    location.href=iosURL;
    }else{
         if(isWx){
            var wxContent = '<img src="//m.ppdaicdn.com/img/app/public.png" class="wx_img">';
            $(wxContent).appendTo($('body'));
         }
           location.href=androidURL;
    }
});
//Growingio统计代码；
    var _vds = _vds || [];
    window._vds = _vds;
    (function(){
        _vds.push(['setAccountId', 'b9598a05ad0393b9']);
        var IsAuthenticated = "@WapBaseController.IsAuthenticated".toLowerCase();
        if (IsAuthenticated == "true") {
            _vds.push(['setCS1', 'user_name', '@Html.Raw(WapBaseController.PPDUser.UserName)']);
        } //这一段是绑定用户
        (function () {
            var vds = document.createElement('script');
            vds.type = 'text/javascript';
            vds.async = true;
            vds.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'dn-growing.qbox.me/vds.js';
            var s = document.getElementsByTagName('script')[0];
            s.parentNode.insertBefore(vds, s);
        })();
    })();
</script>
</html>